<template>
    <div>

        <el-form ref="form" :model="form" label-width="80px" class="from">
            <span style="margin: 0 100px">个人信息</span>
            <el-form-item label="姓名">
                <el-input v-model="form.username"></el-input>
            </el-form-item>
            <el-form-item label="昵称">
                <el-input v-model="form.nickname"></el-input>
            </el-form-item>
            <el-form-item label="邮箱">
                <el-input v-model="form.email"></el-input>
            </el-form-item>
            <el-form-item label="电话">
                <el-input v-model="form.phoneNumber"></el-input>
            </el-form-item>
            <el-form-item label="生日">
                <el-input v-model="form.birth"></el-input>
            </el-form-item>
        </el-form>
    </div>
</template>

<script>
    import {getUserInfo} from "../../api/users";

    export default {
        name: 'Welcome',
        data() {
            return {
                form: {}
            }
        },
        methods: {
            async getUser(){
                const data = await getUserInfo();
                this.form = data.data.data.user
            }
        },
        mounted() {
            this.getUser();
        }
    }
</script>

<style scoped>
    .from {
        width: 300px;
    }
</style>
